﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace BookOnline.Data
{
    public class SqlDataProvider
    {
        static string strcnn = System.Configuration.ConfigurationManager.ConnectionStrings["BookOnline"].ConnectionString;
        public static SqlConnection connection;
        public SqlDataProvider()
        {
            if (connection == null) { connection = new SqlConnection(strcnn); }
        }
        public static SqlConnection getConnect()
        {
            if (connection.State == ConnectionState.Closed)
            {
                connection.Open();
                return connection;
            }
            else
                return connection;
        }
    }
}
